<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    用户名：<input type="text"><br>
    密&nbsp;&nbsp;&nbsp;码：<input type="text"><br>
    <button onclick="alert('用户名或密码错误')">提交</button><br>
    <script>
        //1.警告框
        //2.输入框
        var myName = prompt('请输入姓名：');       //接收用户的输入值
        //alert(myName);                             //通过警告框将用户的值弹出
        //3.带有默认值的输入框
        prompt('请输入班级：','23软件1班');
        //4.在网页中输出内容
        document.write('<h1 style="color:red">个人信息</h1>');
        document.write('<div style="color:#667788;font-size:24px">班级：</div>');
        document.write('<div style="color:#667788;font-size:24px">班级：'+myName+'</div>');
        //5.在控制台输出内容
        console.log('hello 控制台');
    </script>
</body>
</html>